//
//  DLTabBar.m
//  delongzhitou
//
//  Created by Mr.Wang on 2018/11/26.
//  Copyright © 2018 delongzhitou. All rights reserved.
//

#import "DLTabBar.h"

@implementation DLTabBar

#pragma mark - Override Methods
- (void)setFrame:(CGRect)frame{
    if (self.superview &&CGRectGetMaxY(self.superview.bounds) !=CGRectGetMaxY(frame)) {
        
        frame.origin.y =CGRectGetHeight(self.superview.bounds) -CGRectGetHeight(frame);
        
    }
    [super setFrame:frame];
}

#pragma mark - Initial Methods

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.translucent = false;
        self.backgroundColor = [UIColor whiteColor];
        
        //去掉tabBar顶部线条
        CGRect rect = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
        UIGraphicsBeginImageContext(rect.size);
        CGContextRef context = UIGraphicsGetCurrentContext();
        CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);
        CGContextFillRect(context, rect);
        
        UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
//        [self setBackgroundImage:img];
//        [self setShadowImage:img];
    }
    
    return self;
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
